// MetallographyDlg.h : header file
//

#pragma once

#include "ImageManage.h"

// CMetallographyDlg dialog
class CMetallographyDlg : public CDialog
{
// Construction
public:
	CMetallographyDlg(CWnd* pParent = NULL);	// standard constructor
	~CMetallographyDlg();
// Dialog Data
	enum { IDD = IDD_CRACKGOOGLECAPTCHA_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

	void							ShowImage( IplImage* img, UINT ID );

private:
	void							Morphology(const int& nMpType);
	void							Binary(const int& nBinType,const float &nThrd = 80.0);
	void							DetectEdge(const int& nType);
	void							GetConnectedComponent();



	CString							m_strImageName;
	IplImage						*m_pShowImage;
	IplImage						*m_pImage;
	IplImage						*m_pBwImage;
	IplImage						*m_pMorpImage;
	IplImage						*m_pEdgepImage;

	CImageManage					m_cImage;

	//void							ShowImage( IplImage* img, UINT ID );

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()

public:
	afx_msg void OnBnClickedOk();
	afx_msg void OnMainFileLoadImage();
	afx_msg void OnImageBinary();
	afx_msg void OnMetalAdaptiveBinary();
	afx_msg void OnImageGrayScale();
	afx_msg void OnMorphologyClose();
	afx_msg void OnMorphologyOpen();
	afx_msg void OnMorphologyDilate();
	afx_msg void OnMorphologyErode();
	afx_msg void OnMorphologyTophat();
	afx_msg void OnMorphologyBlackhat();
	afx_msg void OnMorphologyGradient();
	afx_msg void OnEdgeSobel();
	afx_msg void OnEdgeCanny();
	afx_msg void OnEdgeLaplace();
	afx_msg void OnBlobConnectedComponent();
	afx_msg void OnBinaryThreshold();
};
